﻿using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;

namespace HalconDotNet
{
	/// <summary>Represents an instance of a sample identifier.</summary>
	// Token: 0x0200005C RID: 92
	[Serializable]
	public class HSampleIdentifier : HHandle, ISerializable, ICloneable
	{
		// Token: 0x06001716 RID: 5910 RVA: 0x0000883B File Offset: 0x00006A3B
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HSampleIdentifier() : base(HHandleBase.UNDEF)
		{
		}

		// Token: 0x06001717 RID: 5911 RVA: 0x00094C2E File Offset: 0x00092E2E
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HSampleIdentifier(IntPtr handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x06001718 RID: 5912 RVA: 0x00094C3D File Offset: 0x00092E3D
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HSampleIdentifier(HHandle handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x06001719 RID: 5913 RVA: 0x00094C4C File Offset: 0x00092E4C
		private void AssertSemType()
		{
			base.AssertSemType("sample_identifier");
		}

		// Token: 0x0600171A RID: 5914 RVA: 0x00094C59 File Offset: 0x00092E59
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HSampleIdentifier obj)
		{
			obj = new HSampleIdentifier(HHandleBase.UNDEF);
			return obj.Load(proc, parIndex, err);
		}

		// Token: 0x0600171B RID: 5915 RVA: 0x00094C74 File Offset: 0x00092E74
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HSampleIdentifier[] obj)
		{
			HTuple htuple;
			err = HTuple.LoadNew(proc, parIndex, err, out htuple);
			obj = new HSampleIdentifier[htuple.Length];
			for (int i = 0; i < htuple.Length; i++)
			{
				obj[i] = new HSampleIdentifier(HalconAPI.IsLegacyHandleMode() ? htuple[i].IP : htuple[i].H);
			}
			htuple.Dispose();
			return err;
		}

		/// <summary>
		///   Read a sample identifier from a file.
		///   Modified instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x0600171C RID: 5916 RVA: 0x00094CE4 File Offset: 0x00092EE4
		public HSampleIdentifier(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(901);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Create a new sample identifier.
		///   Modified instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="genParamName">Parameter name. Default: []</param>
		/// <param name="genParamValue">Parameter value. Default: []</param>
		// Token: 0x0600171D RID: 5917 RVA: 0x00094D30 File Offset: 0x00092F30
		public HSampleIdentifier(HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(915);
			HalconAPI.Store(proc, 0, genParamName);
			HalconAPI.Store(proc, 1, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		// Token: 0x0600171E RID: 5918 RVA: 0x00094D90 File Offset: 0x00092F90
		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = this.SerializeSampleIdentifier();
			byte[] value = hserializedItem;
			hserializedItem.Dispose();
			info.AddValue("data", value, typeof(byte[]));
		}

		// Token: 0x0600171F RID: 5919 RVA: 0x00094DC8 File Offset: 0x00092FC8
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HSampleIdentifier(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = new HSerializedItem((byte[])info.GetValue("data", typeof(byte[])));
			this.DeserializeSampleIdentifier(hserializedItem);
			hserializedItem.Dispose();
		}

		/// <summary>Serialize object to binary stream in HALCON format</summary>
		// Token: 0x06001720 RID: 5920 RVA: 0x00094E08 File Offset: 0x00093008
		public new void Serialize(Stream stream)
		{
			HSerializedItem hserializedItem = this.SerializeSampleIdentifier();
			hserializedItem.Serialize(stream);
			hserializedItem.Dispose();
		}

		/// <summary>Deserialize object from binary stream in HALCON format</summary>
		// Token: 0x06001721 RID: 5921 RVA: 0x00094E1C File Offset: 0x0009301C
		public new static HSampleIdentifier Deserialize(Stream stream)
		{
			HSampleIdentifier hsampleIdentifier = new HSampleIdentifier();
			HSerializedItem hserializedItem = HSerializedItem.Deserialize(stream);
			hsampleIdentifier.DeserializeSampleIdentifier(hserializedItem);
			hserializedItem.Dispose();
			return hsampleIdentifier;
		}

		// Token: 0x06001722 RID: 5922 RVA: 0x00094E42 File Offset: 0x00093042
		object ICloneable.Clone()
		{
			return this.Clone();
		}

		// Token: 0x06001723 RID: 5923 RVA: 0x00094E4C File Offset: 0x0009304C
		public new HSampleIdentifier Clone()
		{
			HSerializedItem hserializedItem = this.SerializeSampleIdentifier();
			HSampleIdentifier hsampleIdentifier = new HSampleIdentifier();
			hsampleIdentifier.DeserializeSampleIdentifier(hserializedItem);
			hserializedItem.Dispose();
			return hsampleIdentifier;
		}

		/// <summary>
		///   Free the memory of a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		// Token: 0x06001724 RID: 5924 RVA: 0x00094E74 File Offset: 0x00093074
		public void ClearSampleIdentifier()
		{
			IntPtr proc = HalconAPI.PreCall(899);
			base.Store(proc, 0);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Deserialize a serialized sample identifier.
		///   Modified instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="serializedItemHandle">Handle of the serialized item.</param>
		// Token: 0x06001725 RID: 5925 RVA: 0x00094EA8 File Offset: 0x000930A8
		public void DeserializeSampleIdentifier(HSerializedItem serializedItemHandle)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(900);
			HalconAPI.Store(proc, 0, serializedItemHandle);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(serializedItemHandle);
		}

		/// <summary>
		///   Read a sample identifier from a file.
		///   Modified instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x06001726 RID: 5926 RVA: 0x00094EFC File Offset: 0x000930FC
		public void ReadSampleIdentifier(string fileName)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(901);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Serialize a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <returns>Handle of the serialized item.</returns>
		// Token: 0x06001727 RID: 5927 RVA: 0x00094F48 File Offset: 0x00093148
		public HSerializedItem SerializeSampleIdentifier()
		{
			IntPtr proc = HalconAPI.PreCall(902);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HSerializedItem result;
			num = HSerializedItem.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Write a sample identifier to a file.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x06001728 RID: 5928 RVA: 0x00094F90 File Offset: 0x00093190
		public void WriteSampleIdentifier(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(903);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Identify objects with a sample identifier. 
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="image">Image showing the object to be identified.</param>
		/// <param name="numResults">Number of suggested object indices. Default: 1</param>
		/// <param name="ratingThreshold">Rating threshold. Default: 0.0</param>
		/// <param name="genParamName">Generic parameter name. Default: []</param>
		/// <param name="genParamValue">Generic parameter value. Default: []</param>
		/// <param name="rating">Rating value of the identified object.</param>
		/// <returns>Index of the identified object.</returns>
		// Token: 0x06001729 RID: 5929 RVA: 0x00094FCC File Offset: 0x000931CC
		public HTuple ApplySampleIdentifier(HImage image, int numResults, double ratingThreshold, HTuple genParamName, HTuple genParamValue, out HTuple rating)
		{
			IntPtr proc = HalconAPI.PreCall(904);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreI(proc, 1, numResults);
			HalconAPI.StoreD(proc, 2, ratingThreshold);
			HalconAPI.Store(proc, 3, genParamName);
			HalconAPI.Store(proc, 4, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, HTupleType.INTEGER, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out rating);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Identify objects with a sample identifier. 
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="image">Image showing the object to be identified.</param>
		/// <param name="numResults">Number of suggested object indices. Default: 1</param>
		/// <param name="ratingThreshold">Rating threshold. Default: 0.0</param>
		/// <param name="genParamName">Generic parameter name. Default: []</param>
		/// <param name="genParamValue">Generic parameter value. Default: []</param>
		/// <param name="rating">Rating value of the identified object.</param>
		/// <returns>Index of the identified object.</returns>
		// Token: 0x0600172A RID: 5930 RVA: 0x00095068 File Offset: 0x00093268
		public int ApplySampleIdentifier(HImage image, int numResults, double ratingThreshold, HTuple genParamName, HTuple genParamValue, out double rating)
		{
			IntPtr proc = HalconAPI.PreCall(904);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreI(proc, 1, numResults);
			HalconAPI.StoreD(proc, 2, ratingThreshold);
			HalconAPI.Store(proc, 3, genParamName);
			HalconAPI.Store(proc, 4, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			num = HalconAPI.LoadD(proc, 1, num, out rating);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Get selected parameters of a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="genParamName">Parameter name. Default: "rating_method"</param>
		/// <returns>Parameter value.</returns>
		// Token: 0x0600172B RID: 5931 RVA: 0x00095104 File Offset: 0x00093304
		public HTuple GetSampleIdentifierParam(string genParamName)
		{
			IntPtr proc = HalconAPI.PreCall(905);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Set selected parameters of a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="genParamName">Parameter name. Default: "rating_method"</param>
		/// <param name="genParamValue">Parameter value. Default: "score_single"</param>
		// Token: 0x0600172C RID: 5932 RVA: 0x00095154 File Offset: 0x00093354
		public void SetSampleIdentifierParam(string genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(906);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.Store(proc, 2, genParamValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamValue);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Set selected parameters of a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="genParamName">Parameter name. Default: "rating_method"</param>
		/// <param name="genParamValue">Parameter value. Default: "score_single"</param>
		// Token: 0x0600172D RID: 5933 RVA: 0x000951A0 File Offset: 0x000933A0
		public void SetSampleIdentifierParam(string genParamName, double genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(906);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.StoreD(proc, 2, genParamValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Retrieve information about an object of a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="objectIdx">Index of the object for which information is retrieved.</param>
		/// <param name="infoName">Define, for which kind of object information is retrieved. Default: "num_training_objects"</param>
		/// <returns>Information about the object.</returns>
		// Token: 0x0600172E RID: 5934 RVA: 0x000951E4 File Offset: 0x000933E4
		public HTuple GetSampleIdentifierObjectInfo(HTuple objectIdx, HTuple infoName)
		{
			IntPtr proc = HalconAPI.PreCall(907);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, objectIdx);
			HalconAPI.Store(proc, 2, infoName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(objectIdx);
			HalconAPI.UnpinTuple(infoName);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Retrieve information about an object of a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="objectIdx">Index of the object for which information is retrieved.</param>
		/// <param name="infoName">Define, for which kind of object information is retrieved. Default: "num_training_objects"</param>
		/// <returns>Information about the object.</returns>
		// Token: 0x0600172F RID: 5935 RVA: 0x00095248 File Offset: 0x00093448
		public HTuple GetSampleIdentifierObjectInfo(int objectIdx, string infoName)
		{
			IntPtr proc = HalconAPI.PreCall(907);
			base.Store(proc, 0);
			HalconAPI.StoreI(proc, 1, objectIdx);
			HalconAPI.StoreS(proc, 2, infoName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Define a name or a description for an object of a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="objectIdx">Index of the object for which information is set.</param>
		/// <param name="infoName">Define, for which kind of object information is set. Default: "training_object_name"</param>
		/// <param name="infoValue">Information about the object.</param>
		// Token: 0x06001730 RID: 5936 RVA: 0x000952A0 File Offset: 0x000934A0
		public void SetSampleIdentifierObjectInfo(HTuple objectIdx, string infoName, HTuple infoValue)
		{
			IntPtr proc = HalconAPI.PreCall(908);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, objectIdx);
			HalconAPI.StoreS(proc, 2, infoName);
			HalconAPI.Store(proc, 3, infoValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(objectIdx);
			HalconAPI.UnpinTuple(infoValue);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Define a name or a description for an object of a sample identifier.
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="objectIdx">Index of the object for which information is set.</param>
		/// <param name="infoName">Define, for which kind of object information is set. Default: "training_object_name"</param>
		/// <param name="infoValue">Information about the object.</param>
		// Token: 0x06001731 RID: 5937 RVA: 0x000952F8 File Offset: 0x000934F8
		public void SetSampleIdentifierObjectInfo(int objectIdx, string infoName, string infoValue)
		{
			IntPtr proc = HalconAPI.PreCall(908);
			base.Store(proc, 0);
			HalconAPI.StoreI(proc, 1, objectIdx);
			HalconAPI.StoreS(proc, 2, infoName);
			HalconAPI.StoreS(proc, 3, infoValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Remove training data from a sample identifier.  
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="objectIdx">Index of the training object, from which samples should be removed.</param>
		/// <param name="objectSampleIdx">Index of the training sample that should be removed.</param>
		// Token: 0x06001732 RID: 5938 RVA: 0x00095344 File Offset: 0x00093544
		public void RemoveSampleIdentifierTrainingData(HTuple objectIdx, HTuple objectSampleIdx)
		{
			IntPtr proc = HalconAPI.PreCall(909);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, objectIdx);
			HalconAPI.Store(proc, 2, objectSampleIdx);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(objectIdx);
			HalconAPI.UnpinTuple(objectSampleIdx);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Remove training data from a sample identifier.  
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="objectIdx">Index of the training object, from which samples should be removed.</param>
		/// <param name="objectSampleIdx">Index of the training sample that should be removed.</param>
		// Token: 0x06001733 RID: 5939 RVA: 0x00095394 File Offset: 0x00093594
		public void RemoveSampleIdentifierTrainingData(int objectIdx, int objectSampleIdx)
		{
			IntPtr proc = HalconAPI.PreCall(909);
			base.Store(proc, 0);
			HalconAPI.StoreI(proc, 1, objectIdx);
			HalconAPI.StoreI(proc, 2, objectSampleIdx);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Remove preparation data from a sample identifier.  
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="objectIdx">Index of the preparation object, of which samples should be removed.</param>
		/// <param name="objectSampleIdx">Index of the preparation sample that should be removed.</param>
		// Token: 0x06001734 RID: 5940 RVA: 0x000953D8 File Offset: 0x000935D8
		public void RemoveSampleIdentifierPreparationData(HTuple objectIdx, HTuple objectSampleIdx)
		{
			IntPtr proc = HalconAPI.PreCall(910);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, objectIdx);
			HalconAPI.Store(proc, 2, objectSampleIdx);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(objectIdx);
			HalconAPI.UnpinTuple(objectSampleIdx);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Remove preparation data from a sample identifier.  
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="objectIdx">Index of the preparation object, of which samples should be removed.</param>
		/// <param name="objectSampleIdx">Index of the preparation sample that should be removed.</param>
		// Token: 0x06001735 RID: 5941 RVA: 0x00095428 File Offset: 0x00093628
		public void RemoveSampleIdentifierPreparationData(int objectIdx, int objectSampleIdx)
		{
			IntPtr proc = HalconAPI.PreCall(910);
			base.Store(proc, 0);
			HalconAPI.StoreI(proc, 1, objectIdx);
			HalconAPI.StoreI(proc, 2, objectSampleIdx);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Train a sample identifier.  
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="genParamName">Parameter name. Default: []</param>
		/// <param name="genParamValue">Parameter value. Default: []</param>
		// Token: 0x06001736 RID: 5942 RVA: 0x0009546C File Offset: 0x0009366C
		public void TrainSampleIdentifier(HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(911);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, genParamName);
			HalconAPI.Store(proc, 2, genParamValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Add training data to an existing sample identifier. 
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="sampleImage">Image that shows an object.</param>
		/// <param name="objectIdx">Index of the object visible in the SampleImage.</param>
		/// <param name="genParamName">Generic parameter name. Default: []</param>
		/// <param name="genParamValue">Generic parameter value. Default: []</param>
		/// <returns>Index of the object sample.</returns>
		// Token: 0x06001737 RID: 5943 RVA: 0x000954BC File Offset: 0x000936BC
		public int AddSampleIdentifierTrainingData(HImage sampleImage, HTuple objectIdx, HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(912);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, sampleImage);
			HalconAPI.Store(proc, 1, objectIdx);
			HalconAPI.Store(proc, 2, genParamName);
			HalconAPI.Store(proc, 3, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(objectIdx);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(sampleImage);
			return result;
		}

		/// <summary>
		///   Add training data to an existing sample identifier. 
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="sampleImage">Image that shows an object.</param>
		/// <param name="objectIdx">Index of the object visible in the SampleImage.</param>
		/// <param name="genParamName">Generic parameter name. Default: []</param>
		/// <param name="genParamValue">Generic parameter value. Default: []</param>
		/// <returns>Index of the object sample.</returns>
		// Token: 0x06001738 RID: 5944 RVA: 0x00095540 File Offset: 0x00093740
		public int AddSampleIdentifierTrainingData(HImage sampleImage, int objectIdx, HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(912);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, sampleImage);
			HalconAPI.StoreI(proc, 1, objectIdx);
			HalconAPI.Store(proc, 2, genParamName);
			HalconAPI.Store(proc, 3, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(sampleImage);
			return result;
		}

		/// <summary>
		///   Adapt the internal data structure of a sample identifier to the objects to be identified.  
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="removePreparationData">Indicates if the preparation data should be removed. Default: "true"</param>
		/// <param name="genParamName">Generic parameter name. Default: []</param>
		/// <param name="genParamValue">Generic parameter value. Default: []</param>
		// Token: 0x06001739 RID: 5945 RVA: 0x000955BC File Offset: 0x000937BC
		public void PrepareSampleIdentifier(string removePreparationData, HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(913);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, removePreparationData);
			HalconAPI.Store(proc, 2, genParamName);
			HalconAPI.Store(proc, 3, genParamValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Add preparation data to an existing sample identifier. 
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="sampleImage">Image that shows an object.</param>
		/// <param name="objectIdx">Index of the object visible in the SampleImage. Default: "unknown"</param>
		/// <param name="genParamName">Generic parameter name. Default: []</param>
		/// <param name="genParamValue">Generic parameter value. Default: []</param>
		/// <returns>Index of the object sample.</returns>
		// Token: 0x0600173A RID: 5946 RVA: 0x00095614 File Offset: 0x00093814
		public int AddSampleIdentifierPreparationData(HImage sampleImage, HTuple objectIdx, HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(914);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, sampleImage);
			HalconAPI.Store(proc, 1, objectIdx);
			HalconAPI.Store(proc, 2, genParamName);
			HalconAPI.Store(proc, 3, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(objectIdx);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(sampleImage);
			return result;
		}

		/// <summary>
		///   Add preparation data to an existing sample identifier. 
		///   Instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="sampleImage">Image that shows an object.</param>
		/// <param name="objectIdx">Index of the object visible in the SampleImage. Default: "unknown"</param>
		/// <param name="genParamName">Generic parameter name. Default: []</param>
		/// <param name="genParamValue">Generic parameter value. Default: []</param>
		/// <returns>Index of the object sample.</returns>
		// Token: 0x0600173B RID: 5947 RVA: 0x00095698 File Offset: 0x00093898
		public int AddSampleIdentifierPreparationData(HImage sampleImage, int objectIdx, HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(914);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, sampleImage);
			HalconAPI.StoreI(proc, 1, objectIdx);
			HalconAPI.Store(proc, 2, genParamName);
			HalconAPI.Store(proc, 3, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(sampleImage);
			return result;
		}

		/// <summary>
		///   Create a new sample identifier.
		///   Modified instance represents: Handle of the sample identifier.
		/// </summary>
		/// <param name="genParamName">Parameter name. Default: []</param>
		/// <param name="genParamValue">Parameter value. Default: []</param>
		// Token: 0x0600173C RID: 5948 RVA: 0x00095714 File Offset: 0x00093914
		public void CreateSampleIdentifier(HTuple genParamName, HTuple genParamValue)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(915);
			HalconAPI.Store(proc, 0, genParamName);
			HalconAPI.Store(proc, 1, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}
	}
}
